//session
const currentUser = 'currentUser'
//常量名和后台服务定义一致
const token = 'Token'
const authorization = 'Authorization'

// 网关前缀
const gatewayPrefix = '/gateway/out'

// 用户中台根路径
const userMiddleContextPath = 'boboPlanetUserMiddleDev'

//基础配置服务
const baseDictServer = 'boboPlanetBaseDictConfigDev'

//头像访问前缀  nginx转发 完整路径： avatarUrlPrefix + fileName
const avatarUrlPrefix = 'http://localhost:2222/'

//表情包图片地址
const emojiUrl = 'http://localhost:3333/'


//函数防抖的实现=>
const debounce=(fn,wait)=>{
    var timer = null;
    return function(){
        clearTimeout(timer)
        timer = setTimeout(()=>{
            fn()           
        },wait)
    }
}

const userInfo = JSON.parse(sessionStorage.getItem(currentUser));



export{
    gatewayPrefix,
    userMiddleContextPath,
    baseDictServer,
    debounce,
    currentUser,
    token,
    authorization,
    avatarUrlPrefix,
    userInfo,
    emojiUrl
}